package cloud.alibaba.study.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cloud.alibaba.study.entity.base.ResponseVo;
import cloud.alibaba.study.service.IStorageService;

@RestController
@RequestMapping("storage")
public class StorageController {

	@Autowired
	private IStorageService storageService;

	/**
	 * 扣减库存
	 */
	@RequestMapping("/decrease")
	public ResponseVo decrease(Long productId, Integer count) {
		storageService.decrease(productId, count);
		return ResponseVo.success();
	}

}
